home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d15 / mewin.arc / EMACS.W3 < prev    next >
Text File  |  1991-03-12  |  6KB  |  257 lines

  1. ;    EMACS.RC:    Standard micro Startup program
  2. ;            for MicroEMACS 3.9d and above
  3. ;            (C)opyright 1987 by Daniel M Lawrence
  4. ;            Last Update: 10/20/87
  5.  
  6. set $discmd FALSE
  7. write-message "[Setting up....]"
  8.  
  9. ; If you screen "SNOWS", comment this line
  10.     set $flicker "FALSE"
  11.  
  12. ; To use an IBM-PC EGA card, uncomment the following line
  13. ;    set $sres "EGA"
  14. ;
  15. ;    ***** Tom's personal bindings since I disagree with the originals
  16. bind-to-key end-of-line            FN>
  17. bind-to-key beginning-of-line        FN<
  18. bind-to-key end-of-file            FN^>
  19. bind-to-key beginning-of-file        FN^<
  20. set $hardtab 2
  21.  
  22. ;    ***** End of Tom's personal bindings
  23.  
  24. ;    ***** Rebind the Function key group
  25.  
  26. bind-to-key search-forward        FN1
  27. bind-to-key search-reverse        FN2
  28. bind-to-key hunt-forward        FN3
  29. bind-to-key hunt-backward        FN4
  30. bind-to-key execute-macro-1        FN5
  31. bind-to-key execute-macro-2        FN6
  32. bind-to-key next-window            FN7
  33. bind-to-key execute-macro-3        FN8
  34. bind-to-key save-file            FN9
  35. bind-to-key exit-emacs            FN0
  36.  
  37. bind-to-key execute-macro-10        S-FN1
  38. bind-to-key execute-macro-11        S-FN2
  39. bind-to-key execute-macro-12        S-FN3
  40. bind-to-key execute-macro-13        S-FN4
  41. bind-to-key execute-macro-14        S-FN5
  42. bind-to-key execute-macro-15        S-FN6
  43. bind-to-key execute-macro-16        S-FN7
  44. bind-to-key execute-macro-17        S-FN8
  45. bind-to-key execute-macro-18        S-FN9
  46. bind-to-key execute-macro-19        S-FN0
  47.  
  48. ;    Set Default Global modes
  49.  
  50. add-global-mode "blue"
  51. ;bind-to-key next-page FN<
  52. ;bind-to-key previous-page FNC
  53. ;bind-to-key meta-prefix `
  54.  
  55. ;    Toggle function key window display
  56.  
  57. 1    store-macro
  58.     !if %rcfkeys
  59.         !goto rcfoff
  60.     !endif
  61.  
  62. ;    toggle function key window on
  63.     save-window
  64.     1 next-window
  65.     !if &sequal $cbufname "emacs.hlp"
  66.         delete-window
  67.     !endif
  68.     !if ¬ &sequal $cbufname "Function Keys"
  69.         1 split-current-window
  70.         1 select-buffer "Function Keys"
  71.         add-mode "red"
  72.         !force 5 resize-window
  73.         1 goto-line
  74.     !endif
  75.     set %rcfkeys TRUE
  76.     !force restore-window
  77.     !if &sequal $cbufname "Function Keys"
  78.         next-window
  79.     !endif
  80.     write-message "[Function key window ON]"
  81.     !return
  82.  
  83.     ;Toggle the function key window off
  84. *rcfoff
  85.     save-window
  86.     1 next-window
  87.     !if &sequal "Function Keys" $cbufname
  88.         delete-window
  89.     !endif
  90.     !force restore-window
  91.     write-message "[Function key window OFF]"
  92.     set %rcfkeys FALSE
  93. !endm
  94.  
  95. ;    Toggle HELP file onscreen
  96.  
  97. 2 store-macro
  98.     1 next-window
  99.  
  100.     ;Make sure the function key window isn't up!
  101.     !if &sequal $cbufname "Function Keys"
  102.         delete-window
  103.     !endif
  104.     set %rcfkeys FALSE
  105.  
  106.     ;Bring up page 1
  107.     !if ¬ &seq $cbufname "emacs.hlp"
  108.         help
  109.         8 resize-window
  110.         add-mode "red"
  111.         beginning-of-file
  112.         2 forward-character
  113.     !endif
  114.  
  115. *rchelp
  116.  
  117.     write-message "[PgUp/PgDn] Page    [FN6] EXIT     ^G  Exit leaving page on screen"
  118.     update-screen
  119.     set %rctmp >cmd
  120.     !if &seq %rctmp FNZ
  121.         beginning-of-line
  122.         !force search-reverse "=>"
  123.         1 redraw-display
  124.         !goto rchelp
  125.     !endif
  126.     !if &seq %rctmp FNV
  127.         beginning-of-line
  128.         2 forward-character
  129.         !force search-forward "=>"
  130.         1 redraw-display
  131.         !goto rchelp
  132.     !endif
  133.     !if &seq %rctmp FN6
  134.         delete-window
  135.         !if &seq %rcfkeys TRUE
  136.             set %rcfkeys FALSE
  137.             execute-macro-1
  138.         !endif
  139.         write-message "[Help Exited]"
  140.         !return
  141.     !endif
  142.     !if &seq %rctmp ^G
  143.         next-window
  144.         set %rcfkeys FALSE
  145.         write-message "[Help Aborted]"
  146.         !return
  147.     !endif
  148.     !goto rchelp
  149. !endm
  150.  
  151. ;    Load a new page
  152.  
  153. 3    store-macro
  154.     !if &seq &find newpage.cmd ""
  155.         write-message "[Can not find NEWPAGE.CMD]"
  156.         !return
  157.     !endif
  158.     execute-file newpage.cmd
  159. !endm
  160.  
  161. ;procedure to clean out the current page (which is nothing right now)
  162.  
  163. store-procedure    clean
  164.     ; nothing by default
  165. !endm
  166.  
  167. ;    Set up auto CMODE
  168.  
  169. 20    store-macro
  170.     set %rctmp &sin $cfname "."
  171.     !if &equ %rctmp 0
  172.         !return
  173.     !endif
  174.     set %rctmp &mid $cfname &add %rctmp 1 5
  175.     !if &or &seq %rctmp "c" &seq %rctmp "h"
  176.         add-mode "cmode"
  177.     !endif
  178.     !if &seq %rctmp "mss"
  179.         add-mode "wrap"
  180.     !endif
  181. !endm
  182. set $readhook execute-macro-20
  183.  
  184. ;    This function activates the function key window as
  185. ;    a legitimate place to call up function keys
  186.  
  187. 21    store-macro
  188.  
  189.     ;remember where we started, and do the mouse movement
  190.     save-window
  191.     mouse-move-down
  192.  
  193.     ;If not in the function key window... leave
  194.     !if ¬ &sequal $cbufname "Function Keys"
  195.         !return
  196.     !endif
  197.  
  198.     ;Find out what function key were gonna do
  199.     add-mode magic
  200.     2 forward-character
  201.     set %rctmp $search
  202.     !force search-reverse "[fF][0-9]"
  203.     !if &seq $status FALSE
  204.         delete-mode magic
  205.         set $search %rctmp
  206.         !return
  207.     !endif
  208.  
  209.     ;we are on the "f" or "F".  Get the function key type and number now
  210.     set $search %rctmp
  211.     set %fcase lower
  212.     !if &equ $curchar 70
  213.         set %fcase upper
  214.     !endif
  215.     1 forward-character
  216.     set %fnum &chr $curchar
  217.     1 forward-character
  218.     set %fnum &cat %fnum &chr $curchar
  219.     set %fnum &add %fnum 0
  220.     !if &equ %fnum 10
  221.         set %fnum "0"
  222.     !endif
  223.     set %fname &cat "FN" %fnum
  224.     !if &seq %fcase upper
  225.         set %fname &cat "S-" %fname
  226.     !endif
  227.  
  228.     ;save the function
  229.     set %rccmd &bind %fname
  230.     delete-mode MAGIC
  231.  
  232.     ;swallow the up-button
  233.     set %rctmp >c
  234.  
  235.     ;restore the window and exit
  236.     restore-window
  237.  
  238.     ;and then execute it
  239.     execute-named-command &ind %rccmd
  240. !endm    
  241. bind-to-key execute-macro-21 MSa
  242.  
  243. ;    bring up the function key window
  244.  
  245.     1 split-current-window
  246.     select-buffer "Function Keys"
  247.     insert-string "f1 search-> f2 <-search |    MicroEMACS:  Text Editor~n"
  248.     insert-string "f3 hunt->   f4 <-hunt   | ~n"
  249.     insert-string "f5 fkeys    f6 help     |  Available function key Pages include:~n"
  250.     insert-string "f7 nxt wind f8 pg[    ] |    WORD  BOX  EMACS  PASCAL  C   COBOL~n"
  251.     insert-string "f9 save     f10 exit    |  [use the f8 key to load Pages]~n"
  252.     unmark-buffer
  253.     delete-window
  254.     set %rcfkeys FALSE
  255.     execute-macro-1
  256.     set $discmd TRUE
  257.